import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import '@/router/permission'
import store from './store'

import Element from './plugins/element'
import Antd from './plugins/antd'
import Naive from './plugins/naive-ui'
import Vant from './plugins/vant'

// css全局样式重置插件
import 'normalize.css/normalize.css'
import './styles/index.scss'
import './styles/my-element.css'
import 'nprogress/nprogress.css'
import 'animate.css'
import { ElMessage } from 'element-plus'
import { postFile,post,get } from '@/api/api' 
import dayjs from "dayjs"
 

const app = createApp(App);
app.use(router)
app.use(store)
app.use(Element) 
app.use(Naive)
app.use(Vant)

app.config.globalProperties.get = get 
app.config.globalProperties.post = post
app.config.globalProperties.postFile = postFile 
app.config.globalProperties.message = ElMessage 
app.config.globalProperties.dayjs = dayjs 

app.config.globalProperties.isEmpty = function(s){
  return !s || /^\s*$/g.test(s)
}
app.mount('#app')


if (import.meta.env.MODE === 'production') {
  console.log('当前是生产环境')
} else {
  console.log('当前是开发环境')
}
